PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

IconRefToRgn

Converts an IconRef -derived icon into a QuickDraw region.

pascal OSErr IconRefToRgn(
                     RgnHandle theRgn,
                     Rect *iconRect,
                     IconAlignmentType align,
                     IconServicesUsageFlagsiconServicesUsageFlags,
                     IconRef iconRef);

theRgn
A handle to the requested region. You must call the QuickDraw function NewRegion to allocate memory for the region handle before calling the IconRefToRgn function. For more information on the NewRegion function, see Inside Macintosh: Imaging With Quickdraw.

iconRect
A pointer to a value of type Rect . This value defines the area that Icon Services uses as the bounding box of the region.

align
A value of type IconAlignmentType . This value determines how Icon Services aligns the region within the rectangle. for a description of possible return values, see Icon Alignment Constants .

iconServicesUsageFlags
Reserved for future use. Pass the kIconServicesDefaultUsageFlags constant in this parameter.

iconRef
A pointer to a value of type IconRef specifying the icon family to use for drawing the requested region.

function result
A result code. See Icon Services Result Codes for a description of possible return values.
DISCUSSION
Icon Services uses the rectangle and alignment values to automatically select the icon used to generate the region data.

This function is similar to the Icon Utilities function IconSuiteToRegion . For a description of Icon Utilities functions and data structures, see Inside Macintosh: More Macintosh Toolbox.

Note

Icon Services uses the icon's black-and-white mask to determine the region data, even if you provide a deep mask.


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)